#include "Command.h"
#include "Environment.h"
#include "RenderCommand.h"
#include "StaticFileCommand.h"
#include "ExecCommand.h"
#include "RelCommand.h"
#include "UnknownCommand.h"

namespace phnq
{
	namespace phnqlets
	{
		Command* Command::create(string cmdName)
		{
			if(cmdName == "render")
				return new RenderCommand();
			else if(cmdName == "exec")
				return new ExecCommand();
			else if(cmdName == "rel")
				return new RelCommand();
		
			return new UnknownCommand(cmdName);
		}
		
		Command* Command::createStaticFileCommand()
		{
			return new StaticFileCommand();
		}
		
		void Command::dispose(Command* command)
		{
			delete command;
		}
	}
}
